package babo.cd.physicalexperiment.adapter;

import android.content.Context;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class MainViewPageAdapter extends FragmentPagerAdapter {
    private Context mContext;
    private List<Fragment> fragmentList;

    public MainViewPageAdapter(Context context, List<Fragment> fragmentList, FragmentManager fm) {
        super(fm);
        this.mContext = context;
        this.fragmentList = fragmentList;
    }


    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList == null ? 0 : fragmentList.size();
    }

}
